Attribute VB_Name = "modAPI"
Option Explicit

Enum FoxTimeFlags
    FOX_TIME_RESET = &H1
End Enum

Enum FoxCounterFlags
    FOX_COUNTER_RESET = &H1
    FOX_COUNTER_COUNT = &H2
End Enum

'All functions can be controlled by these flags, where
'some functions ignore specific flags.
Enum FoxEffectFlags
    FOX_USE_MASK = &H1
    FOX_ANTI_ALIAS = &H2
    FOX_CHROME_LINEAR = &H4
    FOX_SRC_INVERT = &H100
    FOX_DST_INVERT = &H200
    FOX_MASK_INVERT = &H400
    FOX_SRC_GREYSCALE = &H1000
    FOX_DST_GREYSCALE = &H2000
    FOX_FLIP_X = &H40000
    FOX_FLIP_Y = &H80000
    FOX_TURN_LEFT = &H10000
    FOX_TURN_RIGHT = FOX_FLIP_X Or FOX_FLIP_Y
    FOX_TURN_90DEG = FOX_TURN_LEFT
    FOX_TURN_180DEG = FOX_TURN_RIGHT
    FOX_TURN_270DEG = FOX_FLIP_X Or FOX_FLIP_Y Or FOX_TURN_LEFT
End Enum

Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, _
    lpPoint As POINTAPI) As Long

Public Declare Function FoxMosaic Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Level As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxBrightness Lib "lam.dl" (ByVal HDC As Long, ByVal Handle As Long, ByVal hSrcDC As Long, ByVal SrcHandle As Long, ByVal Brightness As Long, Optional ByVal TransColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxBlur Lib "lam.dl" (ByVal HDC As Long, ByVal Handle As Long, ByVal hSrcDC As Long, ByVal SrcHandle As Long, Blur As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxInvert Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxGreyScale Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxAlphaBlend Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal alpha As Byte, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxAlphaMask Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal hMaskDC As Long, ByVal xMask As Long, ByVal yMask As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxRotate Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Angle As Double, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxOutline Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal LineColor As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxFlip Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxBumpMap Lib "lam.dl" (ByVal DstDC As Long, ByVal DstX As Long, ByVal DstY As Long, ByVal DstW As Long, ByVal DstH As Long, ByVal SrcDC As Long, ByVal SrcX As Long, ByVal SrcY As Long, Optional ByVal MskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxHSL Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Hue As Single, ByVal Saturation As Single, ByVal Lightness As Single, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxHSLRGB Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Hue As Single, ByVal Saturation As Single, ByVal LightnessR As Single, ByVal LightnessG As Single, ByVal LightnessB As Single, ByVal ScaleR As Single, ByVal ScaleG As Single, ByVal ScaleB As Single, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxChrome Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Level As Byte, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxMonochrome Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Level As Byte, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxShift Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Level As Byte, ByVal Shift As Byte, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxPsycho Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Level As Byte, ByVal Shift As Byte, ByVal Effekt As Byte, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxWave Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hScrDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal Size As Long, ByVal Movement As Long, ByVal Shift As Single, ByVal Angle As Double, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long


Public Declare Function FoxCreateFastMask Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxCreateFastData Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, Optional ByVal MaskColor As Long, Optional ByVal flags As FoxEffectFlags) As Long
Public Declare Function FoxFastMask Lib "lam.dl" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal hMaskDC As Long, ByVal xMask As Long, ByVal yMask As Long, Optional ByVal flags As FoxEffectFlags) As Long


Public Declare Function SetCursorPos& Lib "user32" (ByVal X As Long, ByVal Y As Long)
Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Public Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Public Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Public Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long

'Odyssey DLL functions
Public Declare Function EncryptDataFile Lib "odysseydll" (ByRef File As Any, ByVal XorValue As Byte) As Long
Public Declare Function EncryptDataString Lib "odysseydll" (ByRef File As Any, ByVal XorValue As Byte) As Long

'Timing
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Declare Function timeGetTime Lib "winmm.dll" () As Long
Public Declare Function timeBeginPeriod Lib "winmm.dll" (ByVal uPeriod As Long) As Long

'DoEvents replacement
Public Declare Function GetInputState Lib "user32" () As Long
Public Declare Function GetQueueStatus Lib "user32" (ByVal qsFlags As Long) As Long

'INI File Related
Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

'Drawing
Declare Function SetBkMode Lib "gdi32" (ByVal HDC As Long, ByVal nBkMode As Long) As Long
Declare Function SetTextColor Lib "gdi32" (ByVal HDC As Long, ByVal crColor As Long) As Long
Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal HDC As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal HDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

'Shell Execute
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

'Hook
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

'SendMessage
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long

'FindWindow
Public Declare Function GetParent Lib "user32.dll" (ByVal hWnd As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hWnd As Long, ByRef lpdwProcessId As Long) As Long
Public Declare Function GetWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Public Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As Long

'SetPriority
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Public Declare Function GetPriorityClass Lib "kernel32" (ByVal hProcess As Long) As Long

'Steam API
Public Declare Function SteamAPI_Init Lib "steam_api.dll" () As Boolean
Public Declare Function SteamAPI_ISteamFriends_ActivateGameOverlay Lib "steam_api.dll" () As Long
Public Declare Function SteamAPI_ISteamUtils_GetServerRealTime Lib "steam_api.dll" () As Long


